package com.jadeen.service.impl;


import com.jadeen.common.utils.DateUtils;
import com.jadeen.entity.domain.ResourceTag;
import com.jadeen.mapper.ResourceTagMapper;
import com.jadeen.service.IResourceTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 资源标签关联Service业务层处理
 * 
 * @author jadeen
 * @date 2025-08-08
 */
@Service
public class ResourceTagServiceImpl implements IResourceTagService
{
    @Autowired
    private ResourceTagMapper resourceTagMapper;

    /**
     * 查询资源标签关联
     * 
     * @param id 资源标签关联主键
     * @return 资源标签关联
     */
    @Override
    public ResourceTag selectResourceTagById(Long id)
    {
        return resourceTagMapper.selectResourceTagById(id);
    }

    /**
     * 查询资源标签关联列表
     * 
     * @param resourceTag 资源标签关联
     * @return 资源标签关联
     */
    @Override
    public List<ResourceTag> selectResourceTagList(ResourceTag resourceTag)
    {
        return resourceTagMapper.selectResourceTagList(resourceTag);
    }

    /**
     * 新增资源标签关联
     * 
     * @param resourceTag 资源标签关联
     * @return 结果
     */
    @Override
    public int insertResourceTag(ResourceTag resourceTag)
    {
        resourceTag.setCreateTime(DateUtils.getNowDate());
        return resourceTagMapper.insertResourceTag(resourceTag);
    }

    /**
     * 修改资源标签关联
     * 
     * @param resourceTag 资源标签关联
     * @return 结果
     */
    @Override
    public int updateResourceTag(ResourceTag resourceTag)
    {
        return resourceTagMapper.updateResourceTag(resourceTag);
    }

    /**
     * 批量删除资源标签关联
     * 
     * @param ids 需要删除的资源标签关联主键
     * @return 结果
     */
    @Override
    public int deleteResourceTagByIds(Long[] ids)
    {
        return resourceTagMapper.deleteResourceTagByIds(ids);
    }

    /**
     * 删除资源标签关联信息
     * 
     * @param id 资源标签关联主键
     * @return 结果
     */
    @Override
    public int deleteResourceTagById(Long id)
    {
        return resourceTagMapper.deleteResourceTagById(id);
    }

    @Override
    public void deleteResourceTagByResourceId(Long resourceId) {
        resourceTagMapper.deleteResourceTagByResourceId(resourceId);
    }
}
